import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  build: {
    outDir: 'dist',
    minify: false,
    emptyOutDir: true,
  },
  server: {
    port: 3000,
    proxy: {
      "/es2": {
        target: "http://www.onceio.top",
        changeOrigin: true, // 允许跨域
        secure: false,  //忽略安全证书   
        rewrite: (path) => path.replace(/^\/es/, 'es'), // 重写路径把路径变成空字符,
      }
    }
  }
});
